package com.xmotor.testjavaxvalidation.controller;

import org.hibernate.validator.constraints.NotBlank;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.constraints.NotNull;

@Validated
@RestController
@RequestMapping("/v2")
public class TestControllerV2 {

    @RequestMapping(value = "/testNotVO",method = RequestMethod.POST)
    public void test2(@NotNull(message = "id不能为空")Integer id,
                      @NotBlank(message = "name不能为空")String name) throws Exception{
        System.out.println(id);
        System.out.println(name);
    }

}
